** Replication code data:
** Hamel, Brian T. "Inequality in the Classroom:
** Electoral Incentives and the Distribution of Local Education Spending." JOP

** Load data 
use "dta.dta"

** Prep the data -- creating variables for fixed effects and clustered SEs
encode grade, gen(grade_)
egen district_election = group(district election) 
egen district_school_year = group(district school_year) 
egen grade_school_election = group(grade_ SCHOOL_ID election)
egen grade_school = group(grade_ SCHOOL_ID)
set matsize 11000

*************
** TABLE 1 **
*************

** Column 1
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 2
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct    no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_school i.district_school_year, vce(cl grade_school_election)
** Column 3
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 4
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_school i.district_school_year, vce(cl grade_school_election)

**************
** FIGURE 2 **
**************

reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
margins, at(top_two_winner_pct = (15(1)100)) atmeans post
** The next line of (commented-out) code saves these probabilities. These are loaded into R. Figure 2 is created in Figure2.R
** outreg2 using "bmp_vote_probs.txt", excel replace noaster dec(6)  sideway noparen stats(coef se pval)

*************
** TABLE 2 **
*************

** Column 1
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct##i.time_to_election  c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 2
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct##i.time_to_election   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)

*************
** TABLE 3 **
*************

** Column 1
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct c.top_two_winner_pct#i.on_cycle c.top_two_winner_pct#c.top_two_winner_pct#i.on_cycle  c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 2
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct c.top_two_winner_pct#i.on_cycle c.top_two_winner_pct#c.top_two_winner_pct#i.on_cycle  c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)

**************
** TABLE A6 **
**************

reg ldp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
reg ldp_received c.top_two_winner_pct##c.top_two_winner_pct    no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_school i.district_school_year, vce(cl grade_school_election)
reg ldp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
reg ldp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct    no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_school i.district_school_year, vce(cl grade_school_election)


**************
** FIGURE 4 **
**************

reg ldp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
margins, at(top_two_winner_pct = (15(1)100)) atmeans post
** The next line of (commented-out) code saves these probabilities. These are loaded into R. Figure 4 is created in Figure4.R
** outreg2 using "ldp_vote_probs.txt", excel replace noaster dec(6)  sideway noparen stats(coef se pval)


**************
** TABLE A1 **
**************

** Column 1
reg bmp_received_nonjoint c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 2
reg bmp_received_nonjoint c.top_two_winner_pct##c.top_two_winner_pct    no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_school i.district_school_year, vce(cl grade_school_election)
** Column 3
reg bmp_amount_nonjoint_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 4
reg bmp_amount_nonjoint_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct    no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_school i.district_school_year, vce(cl grade_school_election)

***************
** FIGURE A4 **
***************

** These regressions remove on district-election combination at a time
** The coefficients for "c.top_two_winner_pct##c.top_two_winner_pct" were pasted into R. Figure A4 is created using the code in FigureA4.R

** Figure A4, Panel A **
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 2 | election != 2009, vce(cl grade_school_election)
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 4 | election != 2009, vce(cl grade_school_election)
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 6 | election != 2009, vce(cl grade_school_election)

reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 1 | election != 2011, vce(cl grade_school_election)
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 3 | election != 2011, vce(cl grade_school_election)
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 5 | election != 2011, vce(cl grade_school_election)
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 7 | election != 2011, vce(cl grade_school_election)

reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 2 | election != 2013, vce(cl grade_school_election)
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 4 | election != 2013, vce(cl grade_school_election)
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 6 | election != 2013, vce(cl grade_school_election)

reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 1 | election != 2014, vce(cl grade_school_election)

reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 1 | election != 2015, vce(cl grade_school_election)
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 3 | election != 2015, vce(cl grade_school_election)
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 5 | election != 2015, vce(cl grade_school_election)
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 7 | election != 2015, vce(cl grade_school_election)

reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 2 | election != 2017, vce(cl grade_school_election)
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 4 | election != 2017, vce(cl grade_school_election)
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 6 | election != 2017, vce(cl grade_school_election)

reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 5 | election != 2019, vce(cl grade_school_election)

** Figure A4, Panel B **
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 2 | election != 2009, vce(cl grade_school_election)
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 4 | election != 2009, vce(cl grade_school_election)
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 6 | election != 2009, vce(cl grade_school_election)

reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 1 | election != 2011, vce(cl grade_school_election)
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 3 | election != 2011, vce(cl grade_school_election)
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 5 | election != 2011, vce(cl grade_school_election)
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 7 | election != 2011, vce(cl grade_school_election)

reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 2 | election != 2013, vce(cl grade_school_election)
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 4 | election != 2013, vce(cl grade_school_election)
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 6 | election != 2013, vce(cl grade_school_election)

reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 1 | election != 2014, vce(cl grade_school_election)

reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 1 | election != 2015, vce(cl grade_school_election)
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 3 | election != 2015, vce(cl grade_school_election)
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 5 | election != 2015, vce(cl grade_school_election)
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 7 | election != 2015, vce(cl grade_school_election)

reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 2 | election != 2017, vce(cl grade_school_election)
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 4 | election != 2017, vce(cl grade_school_election)
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 6 | election != 2017, vce(cl grade_school_election)

reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year if district != 5 | election != 2019, vce(cl grade_school_election)

**************
** TABLE A2 **
**************

** Column 1
reg bmp_received turnout c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 2
reg bmp_received turnout c.top_two_winner_pct##c.top_two_winner_pct    no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_school i.district_school_year, vce(cl grade_school_election)
** Column 3
reg bmp_amount_asinh_pp turnout c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 4
reg bmp_amount_asinh_pp turnout c.top_two_winner_pct##c.top_two_winner_pct    no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_school i.district_school_year, vce(cl grade_school_election)

**************
** TABLE A3 **
**************

** Column 1
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct c.turnout c.top_two_winner_pct#c.turnout c.turnout#c.top_two_winner_pct#c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 2
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct c.turnout c.top_two_winner_pct#c.turnout c.turnout#c.top_two_winner_pct#c.top_two_winner_pct  no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_school i.district_school_year, vce(cl grade_school_election)
** Column 3
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct c.turnout c.top_two_winner_pct#c.turnout c.turnout#c.top_two_winner_pct#c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 4
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct c.turnout c.top_two_winner_pct#c.turnout c.turnout#c.top_two_winner_pct#c.top_two_winner_pct    no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_school i.district_school_year, vce(cl grade_school_election)

***************
** FIGURE A3 **
***************
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct c.turnout c.top_two_winner_pct#c.turnout c.turnout#c.top_two_winner_pct#c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
margins, at(turnout = (6.57 22.66) top_two_winner_pct = (15(1)100)) atmeans post
** The next line of (commented-out) code saves these probabilities. These are loaded into R. Figure 2 is created in Figure2.R
** outreg2 using "bmp_vote_turnout_probs.txt", excel replace noaster dec(6)  sideway noparen stats(coef se pval)


**************
** TABLE A4 **
**************

** Column 1
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_coethnic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 2
reg bmp_received c.top_two_winner_pct##c.top_two_winner_pct    no_formula formula_asinh_pp pct_coethnic pct_el pct_free_lunch resident resident_nb i.grade_school i.district_school_year, vce(cl grade_school_election)
** Column 3
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_coethnic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 4
reg bmp_amount_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct    no_formula formula_asinh_pp pct_coethnic pct_el pct_free_lunch resident resident_nb i.grade_school i.district_school_year, vce(cl grade_school_election)


**************
** TABLE A5 **
**************

** Column 1
reg bmp_tech_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 2
reg bmp_security_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 3
reg bmp_exterior_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 4
reg bmp_interior_received c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 5
reg bmp_tech_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 6
reg bmp_security_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 7
reg bmp_exterior_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)
** Column 8
reg bmp_interior_asinh_pp c.top_two_winner_pct##c.top_two_winner_pct   c.school_age##c.school_age no_formula formula_asinh_pp pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_ i.district_election i.school_year, vce(cl grade_school_election)


**************
** TABLE A7 **
**************

reg log_pp_stloc_raw_CA c.top_two_winner_pct##c.top_two_winner_pct c.school_age##c.school_age pct_white pct_black pct_hispanic pct_el pct_free_lunch resident resident_nb i.grade_, vce(cl grade_school)

